<template>
    <table class="table table-border" border="1">
        <tr>
            <td>姓名</td>
            <td>性别</td>
            <td>年龄</td>
            <td>手机号</td>
            <td>操作</td>
        </tr>
        <tr v-for="item in info">
            <td>{{ item.name }}</td>
            <td>{{ item.sex }}</td>
            <td>{{ item.age }}</td>
            <td>{{ item.phone }}</td>
            <td>操作</td>
        </tr>
    </table>
</template>

<script setup lang="ts">
import { ref,onMounted } from 'vue';
import axios from 'axios';
import router from '@/router';
onMounted(()=>{
show();
})
const info=ref([{
    "id": 0,
  "name": "",
  "pwd": "",
  "sex": "",
  "age": 0,
  "phone": ""
}])
const show=()=>{
    axios.get("https://localhost:7258/api/user/list").then(res=>{
        console.log(res.data);
        info.value=res.data;
    })
}
</script>

<style scoped>

</style>